import jscookie from 'js-cookie';

const KEY = 'SECURITY_TOKEN';
const INFO_KEY = 'SECURITY_INFO';

export const setToken = (token) => {
    jscookie.set(KEY, token);
}

export const getToken = () => {
    return jscookie.get(KEY);
}

export const removeToken = () => {
    jscookie.remove(KEY);
}

export const setMessage = (info) => {
    jscookie.set(INFO_KEY, JSON.stringify(info));
}

export const getMessage = () => {
    return jscookie.get(INFO_KEY);
}

export const removeMessage = () => {
    jscookie.remove(INFO_KEY);
}